package gui;

import java.io.IOException;
import javax.xml.parsers.ParserConfigurationException;

import org.xml.sax.SAXException;

import persistencia.Comparador;
import persistencia.DownloadWSDL;
import persistencia.Parse;


public class Interface {
	public static void main(String args[]) throws ParserConfigurationException, SAXException, IOException{
		Comparador comparador = new Comparador();
		DownloadWSDL wsdlBaixado = new DownloadWSDL();
		Parse parseXPEWS = new Parse("hostel.xml");
		Parse parseWSDL = new Parse();
		
		comparador.inserirXPEWSNaHash(parseXPEWS.getPewsOperations());
		comparador.inserirBehaviourNaHash(parseXPEWS.getBehaviour());
		
		for(String url : comparador.listarLinksNsBehaviour()){
			wsdlBaixado.setUri(url);
			wsdlBaixado.baixar("Aqui");
		}
		
		for(String wsdl : wsdlBaixado.getWsdlsBaixados()){
			parseWSDL.setArquivoWSDL(wsdl);
			comparador.inserirWSDLNaHash(parseWSDL.getPortType());
		}
		
		
		/*System.out.printf("\n----------------------------\n\n");
		
		for(String op : comparador.listarOperationsXPEWSEFormatar())
			System.out.printf("%s\n", op);
		
		System.out.printf("\n----------------------------\n\n");
		
		for(String op : comparador.compararTodosEFormatar())
			System.out.printf("%s\n", op);*/
		
		//SOAPMsg.vai(parseWSDL.getSchema(), targetNamescpace, arg0, arg0Value)
		parseWSDL.wsdlParseSchema();
	}
}
